package vn.fpt.fsoft.menugame;

import java.awt.Graphics2D;
import java.awt.image.BufferedImage;
import java.util.Timer;
import java.util.TimerTask;

import javax.swing.SwingUtilities;

import vn.fpt.fsoft.coreframework.Sprite;

public class SplashScreen extends GameScreen{

	public static final long INTERVAL = 120;
	private BufferedImage background;
	Sprite sprite;
	private ScreenManager screenManager;
	
	private Timer timer;
	private TimerTask timerTask;
	
	public SplashScreen(ScreenManager screenManager) {
		super(screenManager);
		this.screenManager = screenManager;
		sprite = new Sprite();
		background = sprite.getSprite("images/background.png");
		
	}

	@Override
	public void gameUpdate() {
		super.gameUpdate();
		try {
			Thread.sleep(INTERVAL);
		} catch (InterruptedException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		timerTask = new TimerTask() {
			
			@Override
			public void run() {
				
			}
		};
//		timer.schedule(timerTask, INTERVAL);
		screenManager.addScreen(new MainMenu(screenManager));
		screenManager.removeScreen(this);
	}

	@Override
	public void gameKeyPressed(int keyCode) {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void gameDraw(Graphics2D g) {
		g.drawImage(background, 0, 0, 800, 600, 0, 0, background.getWidth(),
				background.getHeight(), null);
		
		g.drawString("CREDIT", 400, 100);
	}

}
